home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
- <stack>
- <name>in</name>
- <id>-1</id>
- <cardCount>11</cardCount>
- <cardID>2878</cardID>
- <listID>5709</listID>
- <cantModify><false /></cantModify>
- <cantDelete><true /></cantDelete>
- <cantAbort><false /></cantAbort>
- <cardSize>
- <width>512</width>
- <height>342</height>
- </cardSize>
- <script>on openStack
- global runHilite, External_Error, StackName, menuVis, msgVis
- put "" into External_Error
- put false into runHilite
- put true into menuVis
- put false into msgVis
- put word two of the long name of this stack into tmp
- put length(tmp) into len
- put char 2 to (len-1) of tmp into StackName
- set lockscreen to true
- push card
- go to card "Add"
- send InitAdd
- go to card "Paste"
- send InitPaste
- pop card
- set lockscreen to false
- end openStack
-
- -- determine line hit for mouse down in field
- function Clickline
- if the style of the target is "scrolling" then
- put the scroll of the target into s
- else
- put zero into s
- end if
- return (trunc((s ¬
- + (item two of the clickloc) ¬
- - (item two of the rect of the target)) ¬
- div the textheight of the target) + one)
- end Clickline
-
- -- should be simpler!
- function number_of_cards_of_this_background
- if the version >= 1.2 then
- return the number of cds of this bg
- end if
- set lockscreen to true
- put the name of this card into start
- put 1 into count
- go to next card of this background
- repeat while (the name of this card) <> start
- add 1 to count
- go to next card of this background
- end repeat
- set lockscreen to false
- return count
- end number_of_cards_of_this_background
-
- on AddCard type, name
- if type = "XCMD" then
- go to last card of background "Commands"
- else if type = "XFCN" then
- go to last card of background "Functions"
- else if type = "ICON" then
- go to last card of background "Icons"
- else if type = "CURS" then
- go to last card of background "Cursors"
- else if type = "snd " then
- go to last card of background "Sounds"
- else
- exit AddCard
- end if
- AddNewCard name
- end AddCard
-
- -- deleteCard & newCard, be fancy with next and prev buttons
- on deleteCard
- if number_of_cards_of_this_background() = 2 then
- set visible of background button "Next" to false
- set visible of background button "Prev" to false
- set visible of background button "Scan" to false
- else
- set visible of background button "Next" to true
- set visible of background button "Prev" to true
- set visible of background button "Scan" to true
- end if
- end deleteCard
-
- on newCard
- if number_of_cards_of_this_background() = 1 then
- set visible of background button "Next" to false
- set visible of background button "Prev" to false
- set visible of background button "Scan" to false
- else
- set visible of background button "Next" to true
- set visible of background button "Prev" to true
- set visible of background button "Scan" to true
- end if
- end newCard
-
- on doHilite
- global runHilite
-
- if runHilite and not (visible of msg) then
- highlight a
- end if
- put not runHilite into runHilite
- end doHilite
-
- on resetHighlight
- put "" into background field "HighlightAreas"
- end resetHighlight
-
- -- deleteRes & renameRes, used for "card" resources e.g. XCMDs
- on deleteRes assoc
- global External_Error, StackName
-
- if number_of_cards_of_this_background() = 1 then
- answer "Sorry, you can't delete the last" ¬
- && background field "resType" with "OK"
- exit deleteRes
- else if (the version >= 1.2) then
- if (the cantDelete of this card) then
- answer "This resource is required by this stack!"
- exit deleteRes
- end if
- end if
-
- answer "PERMANENTLY delete" && ¬
- background field "Name" & "?" with "Yes" or "No"
- if it = "Yes"
- then
- ResHandle "dele", StackName, background field "resType", background field "Name"
- if "ok" is in External_Error then
- if assoc <> "" then
- repeat while number of lines in assoc > 1 do
- put line 1 of assoc into rname
- delete line 1 of assoc
- put word 1 of rname into rtype
- delete word 1 of rname
- ResHandle "dele", StackName, rtype, rname
- end repeat
- end if
- put the name of next card of this background into dest
- doMenu "Delete Card"
- go to dest
- else
- answer "Delete failed:" && External_